<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>couchdb.tools.replication_helper</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="couchdb-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="../index.html">Documentation Index</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="couchdb-module.html">Package&nbsp;couchdb</a> ::
        <a href="couchdb.tools-module.html">Package&nbsp;tools</a> ::
        Module&nbsp;replication_helper
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module replication_helper</h1><p class="nomargin-top"></p>
<p>CouchDB <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><span class="pre">update_notification</span></tt> script that triggers replication.</p>
<p>Daemon script that can be used as a CouchDB <tt class="rst-docutils literal"><span class="pre">update_notification</span></tt> process
and triggers replication on each incoming database update between the
specified servers.</p>
<p>Setup:
Add this to your local.ini, in the section <tt class="rst-docutils literal"><span class="pre">[update_notification]</span></tt>:</p>
<pre class="rst-literal-block">
replication = /path/to/couchdb-replicate \
  --source-server=http://127.0.0.1/ \
  --target-server=http://127.0.0.1:5985/
</pre>
<p>Format of the messages it reads:</p>
<pre class="rst-literal-block">
{&quot;db&quot;:&quot;replication_notification_test&quot;,&quot;type&quot;:&quot;updated&quot;}
</pre>
<dl class="rst-docutils">
<dt>TODO:</dt>
<dd><ul class="rst-first rst-last rst-simple">
<li>Generic'-out the listener part and implement the resplication trigger as
a delegate or subclass.</li>
<li>Check if sub-second sleep delays are possible</li>
</ul>
</dd>
</dl>

<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Classes</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="couchdb.tools.replication_helper.ReplicationHelper-class.html" class="summary-name">ReplicationHelper</a><br />
      Listener daemon for CouchDB database notifications
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Functions</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="main"></a><span class="summary-sig-name">main</span>()</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Variables</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="log"></a><span class="summary-name">log</span> = <code title="logging.getLogger('couchdb.tools.replication_helper')">logging.getLogger('couchdb.tools.replication_helper')</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="couchdb.tools.replication_helper-module.html#URLSPLIT_RE" class="summary-name">URLSPLIT_RE</a> = <code title="re.compile(r'(?x)(?P&lt;scheme&gt;https?://)((?P&lt;username&gt;.*):(?P&lt;password&gt;.\
*)@)?(?P&lt;host&gt;.*)')">re.compile(r'<code class="re-flags">(?x)</code><code class="re-group">(?P&lt;</code><code class="re-ref">scheme</code><code class="re-group">&gt;</code>https<code class="re-op">?</code>://<code class="re-group">)</code><code class="re-group">(</code><code class="re-group">(?P&lt;</code><code class="re-ref">usern</code><code class="variable-ellipsis">...</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'couchdb.tools'"><code class="variable-quote">'</code><code class="variable-string">couchdb.tools</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES DETAILS ==================== -->
<a name="section-VariablesDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Variables Details</span></td>
</tr>
</table>
<a name="URLSPLIT_RE"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">URLSPLIT_RE</h3>
  
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
re.compile(r'<code class="re-flags">(?x)</code><code class="re-group">(?P&lt;</code><code class="re-ref">scheme</code><code class="re-group">&gt;</code>https<code class="re-op">?</code>://<code class="re-group">)</code><code class="re-group">(</code><code class="re-group">(?P&lt;</code><code class="re-ref">username</code><code class="re-group">&gt;</code>.<code class="re-op">*</code><code class="re-group">)</code>:<code class="re-group">(?P&lt;</code><code class="re-ref">password</code><code class="re-group">&gt;</code>.<code class="re-op"></code><span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
<code class="re-op">*</code><code class="re-group">)</code>@<code class="re-group">)</code><code class="re-op">?</code><code class="re-group">(?P&lt;</code><code class="re-ref">host</code><code class="re-group">&gt;</code>.<code class="re-op">*</code><code class="re-group">)</code>')
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="couchdb-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="../index.html">Documentation Index</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Dec 14 15:25:33 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
